﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NetFrameworkExtensions.Enterprise.Bus
{
  public interface IChangeSubscriptions
  {
    void AddSubscription(EventHandler<EntityChangedEventArgs> eventHandler);
    void RemoveSubscription(EventHandler<EntityChangedEventArgs> eventHandler);
    void AddSubscription<TEntity>(EventHandler<EntityChangedEventArgs<TEntity>> eventHandler) where TEntity : class;
    void RemoveSubscription<TEntity>(EventHandler<EntityChangedEventArgs<TEntity>> eventHandler) where TEntity : class;

    void PublishChange(object sender, object entity, EntityChangeOperation operation);
    void PublishChange(object sender, object entity, Type entityType, EntityChangeOperation operation);
    void PublishChange<TEntity>(object sender, TEntity entity, EntityChangeOperation operation) where TEntity : class;
  }
}
